package com.mz.ozy.mvp.model;

import android.content.Context;

import com.mz.ozy.constants.Constants;
import com.mz.ozy.net.RetrofitUtils;
import com.mz.ozy.utils.JsonUtils;

import java.util.HashMap;
import java.util.Map;

import io.reactivex.Observable;
import okhttp3.ResponseBody;

/**
 * Created by administrator on 2018/12/3.
 */
public class SwitchRoleModel {


    public Observable<ResponseBody> getRoleLevelList(Context context) {
        Map<String, String> maps = new HashMap<>();
        return RetrofitUtils.getApiService(context).post(Constants.TransCode.TransCode10019, JsonUtils.requestJsonDate(maps), Constants.tokenId);
    }


    public Observable<ResponseBody> addRole(Context context, String nickName, String inviteCode) {
        Map<String, String> maps = new HashMap<>();
        maps.put("uname", nickName);
        maps.put("username", inviteCode);
        return RetrofitUtils.getApiService(context).post(Constants.TransCode.TransCode10031, JsonUtils.requestJsonDate(maps), Constants.tokenId);

    }

    public Observable<ResponseBody> switchRoles(Context context, String uname) {
        Map<String, String> maps = new HashMap<>();
        maps.put("uid", uname);
        return RetrofitUtils.getApiService(context).post(Constants.TransCode.TransCode10020, JsonUtils.requestJsonDate(maps), Constants.tokenId);

    }
}
